<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>inputEx - NumberField Usage</title>

<!-- YUI CSS -->
<link rel="stylesheet" type="text/css" href="../lib/yui/reset-fonts/reset-fonts.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css"> 
<link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">

<!-- InputEx CSS -->
<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />
<!--[if IE 6]><link type='text/css' rel='stylesheet' href='../css/inputEx-IE6.css' /><![endif]-->

<!-- Demo CSS -->
<link rel="stylesheet" type="text/css" href="css/demo.css"/>
<link rel="stylesheet" type="text/css" href="css/dpSyntaxHighlighter.css">

 </head>

 <body>

<h1>inputEx - NumberField Usage</h1>


<!-- Example 1 -->
<div class='exampleDiv'>
	<h2>Basic NumberField creation</h2>
	<p>Use the following code to create a basic inputEx NumberField.</p>
	<div class='demoContainer' id='container1'></div>
	<div class='codeContainer'>
		<textarea name="code" class="JScript">
			field = new inputEx.NumberField({parentEl: 'container1', showMsg: true, value: 0.03});
			var button = inputEx.cn('button', null, null, 'getValue');
			YAHOO.util.Event.addListener(button, "click",function() {
				alert(field.getValue());
			});
			YAHOO.util.Dom.get('container1').appendChild(button);
		</textarea>
	</div>
</div>


<!-- Example 2 -->
<div class='exampleDiv'>
	<h2>Supported format</h2>
	<p>Everything accepted by parseFloat is valid.</p>
	<div class='demoContainer' id='container2'></div>
	<div class='codeContainer'>
		<textarea name="code" class="JScript">
			field2 = new inputEx.NumberField({parentEl: 'container2', showMsg: true, value: '03e-2', required:true, typeInvite:"Float numbers accepted"});
			var button = inputEx.cn('button', null, null, 'getValue');
			YAHOO.util.Event.addListener(button, "click",function() {
				alert(field2.getValue());
			});
			YAHOO.util.Dom.get('container2').appendChild(button);
		</textarea>
	</div>
</div>


<!-- Example 3 -->
<div class='exampleDiv'>
	<h2>Min &amp; Max</h2>
	<p>Check a minimum or a maximum value</p>
	<div class='demoContainer' id='container3'></div>
	<div class='codeContainer'>
		<textarea name="code" class="JScript">
            field3 = new inputEx.NumberField({parentEl: 'container3', showMsg: true, min:-15, max:'1e3', typeInvite:"Numbers between -15 and 1e3 (1000) only", size:40});
			   var button = inputEx.cn('button', null, null, 'getValue');
			   YAHOO.util.Event.addListener(button, "click",function() {
			      alert(field3.getValue());
			   });
			   YAHOO.util.Dom.get('container3').appendChild(button);
		</textarea>
	</div>
</div>

<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="../lib/yui/container/container-min.js"></script>


<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/Field.js"  type='text/javascript'></script>
<script src="../js/fields/StringField.js"  type='text/javascript'></script>
<script src="../js/fields/NumberField.js"  type='text/javascript'></script>

<!-- inputEx examples -->
<script src="js/dpSyntaxHighlighter.js"></script>
<script src="inputex-examples.js"></script>

 </body>
</html>